package lzzy;

public class StudentScore implements Comparable<StudentScore>{
    private String name;
    private String id;
    private double score;

    public StudentScore(String name,String id,double score){
        this.name=name;
        this.id=id;
        this.score=score;
    }

    public String getName() {
        return name;
    }
    public String getId(){
        return id;
    }
    public double getScore(){
        return score;
    }


    public int compareTo(StudentScore o) {
        if (score > o.score)
            return 1;
        else if (score < o.score)
            return -1;
        else
            return 0;
    }

    public String toString(){
        return "Student{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", score='" + score + '\'' +
                '}';
    }

}
